// @ts-ignore
/* eslint-disable */
import request from "@/utils/http";

/** 创建用户 POST /api/user */
export async function createUser(
  body: Api.CreateUserCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Guid>("/api/user", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除用户 DELETE /api/user */
export async function batchDeleteUser(
  body: Api.BatchDeleteUserCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/user", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改用户 PUT /api/user/${param0} */
export async function updateUser(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.updateUserParams,
  body: Api.UpdateUserCommand,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1Boolean>(`/api/user/${param0}`, {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 上传用户头像 POST /api/user/${param0}/avatar */
export async function uploadAvatar(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.uploadAvatarParams,
  body: Api.UploadAvatarCommand,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1Boolean>(`/api/user/${param0}/avatar`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 重置密码 POST /api/user/${param0}/reset-password */
export async function resetPassword(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.resetPasswordParams,
  body: Api.ResetPasswordCommand,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1Boolean>(`/api/user/${param0}/reset-password`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 用户角色 GET /api/user/${param0}/role */
export async function getUserRoleById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.getUserRoleByIdParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1IEnumerable1Guid>(`/api/user/${param0}/role`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 分配角色 POST /api/user/${param0}/role */
export async function assignRoleToUser(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.assignRoleToUserParams,
  body: Api.AssignRoleToUserCommand,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1Boolean>(`/api/user/${param0}/role`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 启用/禁用 POST /api/user/${param0}/status */
export async function setUserEnabledStatus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.setUserEnabledStatusParams,
  body: Api.SetUserEnabledStatusCommand,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1Boolean>(`/api/user/${param0}/status`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 编辑用户偏好 POST /api/user/edit/preferences */
export async function editUserProfile(
  body: Api.EditUserProfileCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/user/edit/preferences", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 我的信息 GET /api/user/mine */
export async function getMine(options?: { [key: string]: any }) {
  return request<Api.Result1UserDetail>("/api/user/mine", {
    method: "GET",
    ...(options || {}),
  });
}

/** 修改我的信息 PUT /api/user/mine */
export async function updateMine(
  body: Api.UpdateMineCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/user/mine", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询 GET /api/user/page */
export async function queryUsers(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.queryUsersParams,
  options?: { [key: string]: any }
) {
  return request<Api.Result1PaginatedData1UserDto>("/api/user/page", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询用户偏好 GET /api/user/preferences */
export async function getUserProfileById(options?: { [key: string]: any }) {
  return request<Api.Result1List1UserPreferenceDto>("/api/user/preferences", {
    method: "GET",
    ...(options || {}),
  });
}

/** 删除用户偏好 DELETE /api/user/preferences */
export async function deleteUserProfile(
  body: Api.DeleteUserProfileCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/user/preferences", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 个人信息 GET /api/user/profile */
export async function getUserByIdQuery(options?: { [key: string]: any }) {
  return request<Api.Result1UserDetail>("/api/user/profile", {
    method: "GET",
    ...(options || {}),
  });
}

/** 注册用户 POST /api/user/register */
export async function register(
  body: Api.RegisterCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/user/register", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
